package com.coderman.utils.response;

/**
 * description: ResultDto <br>
 * date: 2020/7/7 0:03 <br>
 * author: coderman <br>
 * version: 1.0 <br>
 */
public class ResultDto {
    private String  code;
    private String msg;


    public boolean isSuccess(){
        return ResultDataDto.CodeEnum.SUCCESS.getCode().equals(this.code);
    }

    public ResultDto(){}
    public ResultDto(String code,String msg){
        this.code = code;
        this.msg = msg;
    }



    public static ResultDto success(){
        return new ResultDto(ResultDataDto.CodeEnum.SUCCESS.getCode(),"成功");
    }

    public static  ResultDto fail(String code,String msg){
        ResultDto resultDto = new ResultDto(code,msg);
        return resultDto;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
